import Vue from "vue";
import Vuex from "vuex";
import cart from "./cart";
import product from "./product";
import product1 from "./product1";
import cart1 from "./cart1";

import cps from "vuex-persistedstate"
Vue.use(Vuex);

export default new Vuex.Store({
  state:{
    name:"王鹤棣"
  },
  mutations:{},
  actions:{},
  getters:{},
  modules: {//模块化
    cart,
    product,
    product1,
    cart1
  },
  plugins:[cps({
    storage:window.localStorage,//选择存储方式
    key:'cart-app',
    paths:["name","cart.carts"]
  })]
});
